package com.turing.post.report.util;

import java.math.BigInteger;
import java.util.Date;
import java.util.List;

import javax.ejb.Local;
import javax.ejb.Remote;

import com.turing.post.util.PCPSApplicationException;
import com.turing.post.util.PCPSWebInput;

/**
 * 发卡商销售分支机构卡种类面值库存日结表Dao接口
 * 
 * @author yxb
 * 
 */
@Remote
@Local
public interface SaleCardStockDaySettlementDao {

	/**
	 * 插入对象
	 * 
	 * @param scsds
	 */
	public void insert(SaleCardStockDaySettlement scsds)
			throws PCPSApplicationException;

	/**
	 * 根据主键查找
	 * 
	 * @param scsds
	 * @return
	 */
	public SaleCardStockDaySettlement getSaleCardStockDaySettlementByKey(
			SaleCardStockDaySettlement scsds);

	/**
	 * 删除某发卡商某日某销售机构所有的卡库存日结数据
	 * 
	 * @param saleBranchNo
	 *            销售分支机构号
	 * @param tranDate
	 *            帐务日期
	 */
	public void removeAllSaleCardStockDaySettlementByTranDate(
			String saleBranchNo, Date tranDate);

	/**
	 * 根据发卡商销售机构号、日期、卡种类、卡面ID检索小于该日期的最大日期
	 * 
	 * @param saleBranchNo
	 *            销售分支机构号
	 * @param tranDate
	 *            帐务日期
	 * @param cardFaceId
	 *            卡面ID
	 * 
	 * @return
	 */
	public Date getMaxTranDate(String saleBranchNo, Date tranDate,
			BigInteger cardFaceId);

	/**
	 * 卡-5 卡库存结余表(销售机构)
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getSaleCardStockDaySettlementReportByCondition(
			PCPSWebInput webInput, String branchNoCond, String startTime,
			String endTime);

	/**
	 * 卡-5 卡库存结余表(发卡机构)
	 * 
	 * @param webInput
	 * @param tranDate
	 * @return
	 */
	public List<Object[]> getIssueCardStockDaySettlementReportByCondition(
			PCPSWebInput webInput, String branchNoCond, String startTime,
			String endTime);

	public Integer[] getCardStockCount(String branchNoCond, String startTime,
			String endTime);
}
